package com.xuerhua.yxt;

import java.util.Date;

import org.junit.Test;

import com.xuerhua.yxt.common.Configuration;
import com.xuerhua.yxt.utils.HttpClientUtils;
import com.xuerhua.yxt.utils.TextUtil;
import com.xuerhua.yxt.view.SchoolbusListView;

public class SchoolbusLineService extends BaseTest {

	
	@Test
	public void line() {
		try {
			SchoolbusListView view = new SchoolbusListView();
			view.setStudentId(3041);
			view.setStudentName("测试");
			view.setParentOpenid("ovADojunjRoBq8EV3FI3aov2qyPE");
			view.setLineName("测试线");
			view.setBoardTime(new Date());
			String templateId = "vNRhmhepzymHwDzPMKMPXdoTiAuCTnI8wh64wa3C4kw";
			String signUrl = TextUtil.format(Configuration.getInstance().getSchoolbusStudentSign(), 
					new String[]{String.valueOf(new Date().getTime()), 
							String.valueOf(view.getStudentId())});
			HttpClientUtils.doGet(signUrl);
//			String reqUrl = TextUtil.format(Configuration.getInstance().getSchoolbusStudentLocation(), 
//					new String[]{String.valueOf(new Date().getTime()), 
//							String.valueOf(view.getStudentId())});
//			TemplateUtil.schoolbusStudentBoardSend(
//				view.getParentOpenid(), view.getStudentName(), 
//				view.getBoardTime(), view.getLineName(), templateId, reqUrl);
		} catch (Exception e) {
			e.printStackTrace();
		}
	}
}
